<template>
  <el-dialog
    :destroy-on-close="false"
    :show-close="false"
    v-model="dialogVisible"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    align-center
    width="685"
  >
    <div class="add-custom-website">
      <img class="close" @click="close" src="~/assets/img/close.png" alt="" />
      <div class="header">自定义添加网站</div>
      <div class="box">
        <div class="url">
          <el-input
            type="textarea"
            v-model="url"
            placeholder="网站链接"
          ></el-input>
        </div>
        <div class="name">
          <el-input v-model="name" placeholder="名称"></el-input>
        </div>
        <div class="tabs">
          <div class="tab active">在线图标</div>
          <div class="tab">纯色图标</div>
          <div class="tab">本地上传</div>
        </div>
        <div class="desc">
          <div>输入网址后在线图标将会自动获取</div>
          <div>部分网站可能会获取失败，可使用</div>
          <div>纯色图标或本地上传</div>
        </div>
        <div class="footer">
          <el-button class="cancel" @click="close">取消</el-button>
          <el-button class="confirm" @click="close">确认</el-button>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script setup>
const url = ref("");
const name = ref("");
const dialogVisible = ref(false);
const close = () => {
  dialogVisible.value = false;
};
const show = () => {
  dialogVisible.value = true;
};
defineExpose({
  close,
  show,
});
</script>

<style lang="scss" scoped>
.add-custom-website {
  background: #ffffff;
  border-radius: 10px;
  position: relative;
  .close {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  .header {
    height: 68px;
    background: #f0fbf9;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px 10px 0 0;
  }
  .box {
    padding: 20px;
    .url {
      width: 575px;
      height: 190px;
      background: #f4f4f4;
      border-radius: 10px;
      margin: 0 auto;
      font-size: 16px;
      font-weight: 500;
      text-align: LEFT;
      color: #999999;
      padding: 20px;
    }
    .name {
      width: 575px;
      height: 52px;
      background: #f4f4f4;
      border-radius: 10px;
      margin: 20px auto;
      font-size: 16px;
      font-weight: 500;
      text-align: LEFT;
      color: #999999;
      padding: 20px;
    }
    .tabs {
      width: 575px;
      height: 52px;
      background: #f4f4f4;
      border-radius: 100px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      .tab {
        flex: 1;
        font-size: 16px;
        font-weight: 500;
        text-align: center;
        color: #333333;
      }
      .active {
        width: 189px;
        height: 42px;
        background: #ffffff;
        border-radius: 100px;
        color: #32c7aa;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 4px;
      }
    }
    .desc {
      font-size: 13px;
      font-weight: 500;
      text-align: CENTER;
      color: #999999;
      line-height: 20px;
      margin: 40px auto;
    }
    .footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      ::v-deep .el-button.cancel {
        width: 277px;
        height: 52px;
        background: #d8e7e4;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #32c7aa;
      }
      ::v-deep .el-button.confirm {
        width: 277px;
        height: 52px;
        background: #32c7aa;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #fff;
      }
    }
  }
}
</style>
